package cn.itcast.feign.clients;


import cn.itcast.feign.config.DefaultFeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import cn.itcast.feign.pojo.User;

//feign的自定义配置：如果是局部生效，则把它放到对应的@FeignClient这个注解中：
@FeignClient(value = "userservice",configuration = DefaultFeignConfiguration.class)
//@FeignClient("userservice")
public interface UserClient {

    @GetMapping("/user/{id}")
    public User queryById(@PathVariable("id") Long id); //@PathVariable("id"),()里的数据不要省略

}
